from django.forms import ModelForm

class BootstrapModelForm(ModelForm):
    """
    bootStrap样式的ModelForm，继承自ModelForm（）
    """
    def __init__(self,*args,**kwargs):
        super().__init__(*args,**kwargs)
        for _,field in self.fields.items():
            field.widget.attrs = {"class":"form-control","placeholder":field.label}